<%@ include file="/taglibs.jsp"%>
<jsp:directive.page import="java.util.Random"/>
<jsp:directive.page import="java.util.Date"/>
<%if(session.getAttribute("randFormID") == null){
	Random gen = new Random(new Date().getTime());
	session.setAttribute("randFormID", gen.nextInt() + "");
}%>

<title>Winter War Administration - Edit Slot</title>

<html:form action="/wwadmin/slot" focus="slot.slotName">
	<input type="hidden" name="method" value="save"/>
	<input type="hidden" name="formID" value="<%=session.getAttribute("randFormID") %>"/>
	<input type="hidden" name="conID" value="${conID}"/>
	<html:hidden property="slot.slotID"/>
	<table>
		<tbody>
			<tr>
				<td><bean:message key="slot.slotName"/></td>
				<td><html:text property="slot.slotName"/></td>
				<td><bean:message key="slot.isLocked"/></td>
				<td><html:checkbox property="slot.isLocked"/></td>
			</tr>
			<tr>
				<td><bean:message key="slot.startDate"/></td>
				<td>
					<html:text property="slot.startDateDate"/>
					<html:select property="slot.startDateHour">
						<html:option value="01">1</html:option>
						<html:option value="02">2</html:option>
						<html:option value="03">3</html:option>
						<html:option value="04">4</html:option>
						<html:option value="05">5</html:option>
						<html:option value="06">6</html:option>
						<html:option value="07">7</html:option>
						<html:option value="08">8</html:option>
						<html:option value="09">9</html:option>
						<html:option value="10">10</html:option>
						<html:option value="11">11</html:option>
						<html:option value="12">12</html:option>
					</html:select>
					<html:select property="slot.startDateAMPM">
						<html:option value="AM">AM</html:option>
						<html:option value="PM">PM</html:option>
					</html:select>
				</td>
				<td><bean:message key="slot.endDate"/></td>
				<td>
					<html:text property="slot.endDateDate"/>
					<html:select property="slot.endDateHour">
						<html:option value="01">1</html:option>
						<html:option value="02">2</html:option>
						<html:option value="03">3</html:option>
						<html:option value="04">4</html:option>
						<html:option value="05">5</html:option>
						<html:option value="06">6</html:option>
						<html:option value="07">7</html:option>
						<html:option value="08">8</html:option>
						<html:option value="09">9</html:option>
						<html:option value="10">10</html:option>
						<html:option value="11">11</html:option>
						<html:option value="12">12</html:option>
					</html:select>
					<html:select property="slot.endDateAMPM">
						<html:option value="AM">AM</html:option>
						<html:option value="PM">PM</html:option>
					</html:select>
				</td>
			</tr>
			<tr>
				<td><html:submit>Save</html:submit></td>
			</tr>
		</tbody>
	</table>
		<c:forEach var="event" items="${persSlot.events}">
			<c:choose>
				<c:when test="${event.conID == conID }">
					${event.eventName } -- <c:choose><c:when test="${event.status == 1 }">Submitted <a href="event.do?method=edit&conID=${conID }&eventID=${event.eventID }&userID=${event.userID }">(Edit...)</a></c:when><c:when test="${event.status == 2 }">In Review</c:when><c:when test="${event.status == 3 }">Approved (${event.reservedSeats} / ${event.totalSeats})</c:when><c:when test="${event.status == 4 }">Rejected</c:when></c:choose><br>
				</c:when>
			</c:choose>
		</c:forEach>
</html:form>
